wayland: Delay wl_subsurface interface creation until the window is shown
authorCarlos Garnacho <carlosg@gnome.org>
Wed, 25 Feb 2015 14:59:26 +0000 (15:59 +0100)
committerCarlos Garnacho <carlosg@gnome.org>
Mon, 2 Mar 2015 11:11:59 +0000 (12:11 +0100)
It isn't really necessary anytime before, so just make sure it's there only
when the window is visible.

https://bugzilla.gnome.org/show_bug.cgi?id=743427

gdk/wayland/gdkwindow-wayland.c

index 3bfbea1a17c81270e00bd173fdd6f56a56d5af01..aa77641f677cbfa6d5938a0f6e739fe7d82fd439 100644 (file)
@@ -877,9 +877,6 @@ gdk_wayland_window_create_surface (GdkWindow *window)
 
   gdk_wayland_window_sync_opaque_region (window);
   gdk_wayland_window_sync_input_region (window);
-
-  if (GDK_WINDOW_TYPE (window) == GDK_WINDOW_SUBSURFACE)
-    gdk_wayland_window_create_subsurface (window);
 }
 
 static void
@@ -1214,6 +1211,9 @@ gdk_wayland_window_show (GdkWindow *window,
   if (!impl->surface)
     gdk_wayland_window_create_surface (window);
 
+  if (GDK_WINDOW_TYPE (window) == GDK_WINDOW_SUBSURFACE)
+    gdk_wayland_window_create_subsurface (window);
+
   gdk_wayland_window_map (window);
 
   _gdk_make_event (window, GDK_MAP, NULL, FALSE);
@@ -1691,7 +1691,7 @@ gdk_wayland_window_set_transient_for (GdkWindow *window,
           impl->subsurface = NULL;
         }
 
-      if (parent)
+      if (parent && gdk_window_is_visible (window))
         gdk_wayland_window_create_subsurface (window);
     }
 }